/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Games;

/**
 *
 * @author Brandon
 */
public class Board {
    
    private int[][] board;
    public static final int EMPTY = 2;
    public int width = 0;
    public int height = 0;
    
    public Board(int width, int height) {
    	
        board = new int[height][width];
        this.width = width;
        this.height = height;
    }
    
    public int getWidth() {
    	return width;
    }
    
    public int getHeight() {
    	return height;
    }
    
    public void clearBoard() {
        for(int row = 0; row < board.length; row++){
            for(int col = 0; col < board[row].length; col++){
                place(col, row, EMPTY);
            }
        }
    }
    
    public int getFieldValue(int col, int row) {
        return board[row][col];
    }

    // Play a move, possibly clearing a square
    public void place(int column, int row, int piece) {
        board[row][column] = piece;
    }
    
    public int[][] getBoard() {
    	return board;
    }
    
    /*//check if move ok
    public boolean moveOk(int move) {
    	return (move >= 0 && move <= (width*height) && board[move/width][move%height]==EMPTY);
    }*/
}
